@extends('admin.layout')
@section('title',$title)
@section('content')
    <div class="content-wrapper">
        <section class="content-header">
            <h1>
                订单管理
                <small>在这里，你可以浏览订单
                    @if(session('info'))
                        <span id="info" class="text-red">{{session('info')}}</span>
                    @endif
                </small>
            </h1>
            <ol class="breadcrumb">
                <li><a href="{{ url('/admin/index')}}"><i class="fa fa-dashboard"></i> 主页</a></li>
                <li><a href="{{ url('/admin/order')}}">订单管理</a></li>
                <li class="active">订单列表</li>
            </ol>
        <section class="content">
            <div class="row">
                 <div class="col-xs-12">

                    <div class="box">
                        <div class="box-header">
                            <h3 class="box-title">订单列表详情</h3>
                        </div><!-- /.box-header -->
                        <div class="box-body">
                            <table id="example2" class="table table-bordered table-hover">
                            <form action="{{ url('/admin/order')}}">
                                <div class="row">
                                    <div class="col-md-2">
                                        <div class="form-group">
                                            <select name="num" class="form-control">
                                            <!-- 写分页默认参数在页面上显示 -->
                                                <option
                                                    @if(!empty($request['num']) && 
                                                    $request['num'] == 5)
                                                    selected="selected"
                                                    @endif
                                                >5</option>
                                                <option
                                                    @if(!empty($request['num']) && 
                                                    $request['num'] == 10)
                                                    selected="selected"
                                                    @endif
                                                >10</option>
                                                <option
                                                    @if(!empty($request['num']) && 
                                                    $request['num'] == 20)
                                                    selected="selected"
                                                    @endif
                                                >20</option>
                                                <option
                                                    @if(!empty($request['num']) && 
                                                    $request['num'] == 50)
                                                    selected="selected"
                                                    @endif
                                                >50</option>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="col-md-4 col-md-offset-6">
                                         <div class="input-group input-group">
                                                <input type="text" name="keywords" class="form-control" value="{{ $requestp['keywords'] or '' }}">
                                                    <span class="input-group-btn">
                                                      <button class="btn btn-info btn-flat" type="submit">搜索!</button>
                                                    </span>
                                            </div>
                                    </div>
                                </div>
                            </form> 
                                <thead>
                                <tr>
                                    <th>订单ID号</th>
                                    <th>收货人</th>
                                    <th>联系电话</th>
                                    <th>下单时间</th>
                                    <th>状态</th>
                                    <th>操作</th>
                                </tr>
                                </thead>                                
                                <tbody>
                                <!-- 遍历goods数据库中的数据，到页面上显示 -->
                                @foreach($data as $row)
                                <tr>
                                    <td>{{ $row -> oid}}</td>
                                    <td>{{ $row -> rec}}</td>
                                    <td>{{ $row -> tel}}</td>
                                    <td>{{ $row -> otime}}</td>
                                    <td>{{ $row -> status}}</td>
                                    <td>
                                    <a href="{{ url('/admin/order') }}/{{ $row -> oid }}/edit">订单详情</a>
                                    </td>
                                </tr>
                                @endforeach
                                </tbody>

                            </table>
                            <!-- 分页操作 -->
                            {{ $data -> appends($request) -> links() }}
                        </div><!-- /.box-body -->
                    </div><!-- /.box -->
                </div><!-- /.col -->
            </div><!-- /.row -->
        </section><!-- /.content -->
     </div><!-- /.content-wrapper -->

     <!-- ajax  订单库存操作-->
     <script type="text/javascript">
         
         window.onload = function()
         {
           $('#info').fadeOut(1000);
         }
     </script>
@endsection